package com.spa.modules.gen.entity;

import java.io.Serializable;
import java.util.Date;

import org.springframework.format.annotation.DateTimeFormat;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.spa.common.utils.LongToStringUtil;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * 描述: gen_data_info author: P0081447 date: 2022-06-27 20:27:48
 */
@TableName("gen_data_info")
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "数据源表对象", description = "数据源表")
public class GenData implements Serializable {

	private static final long serialVersionUID = 1L;

	@ApiModelProperty(value = "唯一标识")
	@TableId(type = IdType.ASSIGN_UUID)
//	@JsonSerialize(using = LongToStringUtil.class)
	private String id;
	@ApiModelProperty(value = "数据库名称")
	@TableField(value = "db_name")
	private String dbName;
	@ApiModelProperty(value = "驱动")
	@TableField(value = "drive")
	private String drive;
	@ApiModelProperty(value = "目录")
	@TableField(value = "catalog")
	private String catalog;
	@ApiModelProperty(value = "数据源URL")
	@TableField(value = "db_url")
	private String dbUrl;
	@ApiModelProperty(value = "账号")
	@TableField(value = "db_username")
	private String dbUsername;
	@ApiModelProperty(value = "密码")
	@TableField(value = "db_password")
	private String dbPassword;
	@ApiModelProperty(value = "创建人")
	@TableField(value = "create_by", fill = FieldFill.INSERT)
	private String createBy;
	@ApiModelProperty(value = "创建时间")
	@TableField(value = "create_time", fill = FieldFill.INSERT)
	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date createTime;
	@ApiModelProperty(value = "更新人")
	@TableField(value = "update_by", fill = FieldFill.INSERT_UPDATE)
	private String updateBy;
	@ApiModelProperty(value = "更新时间")
	@TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date updateTime;
}
